package com.ruoyi.project.dctmanage.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.dctmanage.domain.DctPatient;
import com.ruoyi.project.dctmanage.service.DcpPatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : author
 * @dath : 16:20  2021/7/14
 */
@RestController
@RequestMapping("/dctmanage/disease")
public class DctPatientController extends BaseController {
    @Autowired
    private DcpPatientService dcpPatientService;

    @PreAuthorize("@ss.hasAnyPermi('dctmanage:disease:query')")
    @GetMapping("/list")
    public TableDataInfo list(DctPatient dctPatient){
        //分页相关,处理请求参数pageNum,pageSize等，并使用PageHelper处理分页查询
        startPage();
        //调用service春查询数据库
       List<DctPatient> list= dcpPatientService.selectList(dctPatient);
        //返回
        return getDataTable(list);
    }

}
